<template>
	<view class="content">
		<view class="all">
			<view class="content_1">
				欢迎来到铺铺通
			</view>
			<view class="content_2">
				手机号
			</view>
			<view class="content_3">
				<input type="text" v-model="form.account" placeholder="请输入手机号" />
			</view>
			<view class="content_2">
				密码
			</view>
			<view class="content_3">
				<u-input :type="password?'password':'text'" v-model="form.password" :password-icon='false'
					:clearable="false" placeholder="请输入密码" />
				<image src="@/static/img/yc.png" @click="password=!password" />
			</view>
			<text class="content_4" @click="submit">登录</text>
			<view class="content_5">
				<text @click="$to('/pages/login/forget')">忘记密码</text>
				<text></text>
				<text @click="$to('/pages/login/register')">立即注册</text>
			</view>
			<view class="content_6">
				<u-divider half-width="55">第三方登录</u-divider>
			</view>
			<view class="wxs">
				<image src="@/static/img/wxd.png" class="wx" />
			</view>
		</view>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				form: {
					password: '',
					account: ''
				},
				password: true
			};
		},
		methods: {
			submit() {
				if (!this.form.account) {
					this.$toast('请输入手机号')
					return
				}
				if (!this.form.password) {
					this.$toast('请输入密码')
					return
				}
				if (!this.$tel(this.form.account)) {
					this.$toast('手机号格式不正确')
					return
				}
				this.api('User/login', this.form).then(res => {
					this.$toast(res.msg)
					uni.setStorageSync('user', res.data.userinfo)
					uni.setStorageSync('token', res.data.userinfo.token)
					uni.navigateBack({

					})
				})
			}
		}
	}
</script>

<style lang="scss">
	.all {
		padding: 25rpx;
	}

	.wxs {
		text-align: center;
		margin-top: 20rpx;
	}

	.wx {
		width: 81rpx;
		height: 81rpx;
	}

	.content_1 {
		margin-top: 200rpx;
		margin-bottom: 100rpx;
		font-size: 50rpx;
		font-family: OPPOSans;
		font-weight: 500;
		color: #181818;
	}

	.content_2 {
		margin-top: 50rpx;
		font-size: 32rpx;
		font-family: OPPOSans;
		font-weight: 600;
		color: #181818;
	}

	//输入框样式
	.content_3 {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin: 10rpx auto;
		height: 80rpx;
		background: #FFFFFF;
		border: 1rpx solid #E1E1E1;
		padding: 0 25rpx 0 25rpx;
		border-radius: 16rpx;

		::v-deep .input-placeholder {
			font-size: 24rpx;
			font-family: OPPOSans;
			font-weight: 400;
			color: #999999;
		}

		image {
			width: 32rpx;
			height: 14rpx;
		}

		input {

			width: 85%;


		}
	}

	.content_4 {
		margin-top: 130rpx;
		height: 80rpx;
		background: #FF1B1B;
		text-align: center;
		line-height: 80rpx;
		border-radius: 40rpx;
		display: inline-block;
		width: 100%;
		font-size: 30rpx;
		font-family: OPPOSans;
		font-weight: 500;
		color: #FFFFFF;
	}

	.content_5 {
		margin-top: 30rpx;
		text-align: center;

		text:nth-of-type(1) {
			font-size: 30rpx;
			font-family: OPPOSans;
			font-weight: 400;
			color: #666666;
		}

		text:nth-of-type(2) {
			display: inline-block;
			width: 2rpx;
			height: 28rpx;
			background: #D2D2D2;
			margin: 0 20rpx 0 20rpx;

		}

		text:nth-of-type(3) {
			font-size: 30rpx;
			font-family: OPPOSans;
			font-weight: 400;
			color: #666666;
		}
	}

	.content_6 {
		margin-top: 130rpx;
	}
</style>
